package com.example.demo03.controller;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("sms")
public class SmsController {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    @GetMapping("send")
    public void send() {
        for (int i = 1; i <= 10000; i++) {
            rabbitTemplate.convertAndSend("sms", i + "");
        }
    }
}
